package com.wenzi.rule.verification.fun;

import org.springframework.expression.spel.support.StandardEvaluationContext;

import java.lang.reflect.Method;
import java.util.HashMap;

public class FunRegister {
    private static HashMap<String, Method> funMap = new HashMap<>();

    public static void register(String name,Method method){
        funMap.put(name,method);
    }

    public static void registerFor(StandardEvaluationContext context){
        funMap.forEach((k,v)->{
            context.registerFunction(k,v);
        });
    }
}
